import 'package:flutter/material.dart';

//ListView列表组件
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Align结合Container的使用'),
          backgroundColor: Colors.pink[100],
        ),
        body: MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    //获取屏幕尺寸
    final size = MediaQuery.of(context).size;
    //Row组件
    return  Container(
      // alignment: Alignment.center,
      width: 300,
      height: 300,
      color: Colors.red,
      child: Align(
        alignment: Alignment.topRight,
        child: Text('Align结合Container的使用'),
      ),
    );
  }
}
